using System.Reflection;
using TddGenerator.Core.Domain;
using TddGenerator.Core.Services;

namespace TddGenerator.Core.Services.Impl
{
    public class TemplateSetRepository : ITemplateSetRepository
    {
        private readonly IFileSystemService fileSystemService;

        public TemplateSetRepository(IFileSystemService fileSystemService)
        {
            this.fileSystemService = fileSystemService;
        }
        public TemplateSet Get()
        {
            string dir = "";
            dir = Assembly.GetAssembly(this.GetType()).Location;
            dir = fileSystemService.GetDirectoryName(dir) + "\\";

            TemplateSet templates = new TemplateSet();
            templates.ClassTemplate = dir+"Templates\\Nunit\\ConcreteClassUnderTest.cs";
            templates.InterfaceTemplate = dir + "Templates\\nunit\\InterfaceUnderTest.cs";
            templates.TestClass = dir + "Templates\\nunit\\InterfaceUnderTestTester.cs";
            templates.Language = "CSharp";
            templates.FileExtension = ".cs";
            return templates;
        }
    }
}